You are here: Statements and Functions > Get
Syntax samples
GET {<quantity>} <resource> {,<priority>}
{AND or OR {quantity} <resource> {,<priority>}...}
GET Res1
GET 3 Res1, 5
GET 2 Res1OR 3 Res2
GET Res1, 3 AND (Res2 OR Res3)
GET Res(Skill_required)
Captures a specified number of resources as they become available. If the entity already possesses one of the requested resources, the entity will still try to capture an additional unit of that resource. When capturing multiple resources, each resource will be captured as soon as it becomes available until all resources are captured.
A resource captured with the GET statement at one location and then released with a FREE statement at another location will not be used to move the entity between locations unless it is also specified in a MOVE WITH statement in the routing move logic. Otherwise, it is the entity that is moving the resource from one location to the next and the resource will not be visible when moving with the entity.
Resources captured by a GET statement can only be preempted when the entity owning the resource is undergoing a WAIT or USE time except in move logic. If the resource is preempted during one of those times, the time will continue where it left off when the resource becomes available.
Every GET must have a corresponding FREE or an error occurs when the entity exits the system. If an entity owns one or more resources and is subsequently temporarily loaded onto or grouped with another entity, it cannot free the resource(s) until it is unloaded or ungrouped.
Location processing, downtime, move, and shift logic. A GET statement cannot follow a move related statement in move logic.
Components
<quantity>
The number of resources to get. A value of zero is ignored and values less than zero return an error. This numeric expression is evaluated and truncated every time the GET statement is encountered.
<resource>
The name of the resource to GET. You can substitute RES() for the resource name.
<priority>
When multiple entities are waiting for the same resource to become available, the entity with the highest priority will capture the resource first. This expression should be a number between 0 and 999.
Example
To start a semi-automatic welding process, we need a static resource named "Operator." Midway through the process, the Operator tests the weld with a resource named "Tester," shared with other operators. After the test, the operator restarts the welder. The Operator stays with the welder until he or she completes the last part of the operation. After the welding process the operator moves the part to the buffing area, completes the buffing operation and then is freed.
Process Table
Entity |
Location |
Operation (min) |
---|---|---|
Assy |
Weld |
USE Operator FOR 4 min GET Operator USE Tester FOR U(2,.5) WAIT 4 min |
Assy |
Buffer |
WAIT T(7,10,11) FREE Operator |
Routing Table
Blk |
Output |
Destination |
Rule |
Move Logic |
---|---|---|---|---|
1 |
Assy |
Buffer |
FIRST 1 |
MOVE FOR 1.5 |
1 |
Assy |
Checker |
FIRST 1 |
MOVE FOR 5 |
JOINTLY GET and USE.